package coder520.mq.controller.service;

import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 *  发布消息
 */
@Component("topicReceicer2")
public class TopicReceicer2 implements MessageListener{


    @Override
    public void onMessage(Message message) {
        try {
            System.out.println("TopicReceicer2message:"+((TextMessage)message).getText());
        } catch (JMSException e) {
            e.printStackTrace();
        }

    }
}
